UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6KIo5TqYrrlbR07PG1TA5/j9WfzyU+6R6loqH3fFNIw=' 
WHERE 
  key_id = '294af942ac68647be8fdb3bae6b184ecec41a0e8187afa7d96b396706c30eba7' 
  AND (
    token = '6KIo5TqYrrlbR07PG1TA5/j9WfzyU+6R6loqH3fFNIw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033