UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u2VU6eZYtDFZCpQUXaNQ6PSqRxODSreTJK/EzCCgs18=' 
WHERE 
  key_id = '38a8c2b747dde10250cb6c0e6e7d1111d01961e93b1e28060300b603fa91f558' 
  AND (
    token = 'u2VU6eZYtDFZCpQUXaNQ6PSqRxODSreTJK/EzCCgs18=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017