UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'txnlixr+wXvTqNohnb77Dd/ca5YdGthDoi3GqnXA3xE=' 
WHERE 
  key_id = '15f6f254b0dcb4c36d3818714efeb80601a7f8e6e5bb982f60ae5e6bf897bc36' 
  AND (
    token = 'txnlixr+wXvTqNohnb77Dd/ca5YdGthDoi3GqnXA3xE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044