UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'twmOeQqCsAJ6rrHt3frR3bduaBqnBUEMGn9q0Ek4kGE=' 
WHERE 
  key_id = 'da6e415fd82cc39fdda99c6a521100d0827c294732cc106ffb54363b00564895' 
  AND (
    token = 'twmOeQqCsAJ6rrHt3frR3bduaBqnBUEMGn9q0Ek4kGE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058