UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dnFkG9l/Uy5yNZ2XkoGDhQ4YY0pkNvnzk8NfSeBkEYo=' 
WHERE 
  key_id = '4baf4eb0c552bb46b3a61136fd46e78c6ac552da54c5d31dabe9e949d01ce2db' 
  AND (
    token = 'dnFkG9l/Uy5yNZ2XkoGDhQ4YY0pkNvnzk8NfSeBkEYo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017