UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'G8Qj21ySmOoOP2uuomum3hLokJisMxt8/6L1F606Oic=' 
WHERE 
  key_id = '6d6e63f5745a38cb628ce7cacee3badbcd0bfbc88b1e4d9b84c54f128a5ed653' 
  AND (
    token = 'G8Qj21ySmOoOP2uuomum3hLokJisMxt8/6L1F606Oic=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049