UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fKVatuWQd2uejrTjH1aaEhyPmrsZcJ5SZyADEjtL5N8=' 
WHERE 
  key_id = '06f3091bdeaadf855829ec23b01e6682b132c08826674f4028235cb2bc5046bc' 
  AND (
    token = 'fKVatuWQd2uejrTjH1aaEhyPmrsZcJ5SZyADEjtL5N8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038