UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zmqfIxFBhWrf+yVGNz57wzxw3VwUSvt56nfdEmIA4gY=' 
WHERE 
  key_id = '1cde2c2c95c7db175e7c94dd7f2b9144bd8eea2b09ea9cc11941255b890c56ba' 
  AND (
    token = 'zmqfIxFBhWrf+yVGNz57wzxw3VwUSvt56nfdEmIA4gY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031