UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZZ2s5sEhDoaEZGGV1yQHgL+yu6QkPzNVmNcQ83CkNBY=' 
WHERE 
  key_id = 'ee67a724c237ca46743b51da34b371bd8dfb846a0cf66c299dc311bfed425f06' 
  AND (
    token = 'ZZ2s5sEhDoaEZGGV1yQHgL+yu6QkPzNVmNcQ83CkNBY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035