UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eGIlx6xcCSHCkH96hxu7q+ffAI6/a0eZhyrMX9I3ihw=' 
WHERE 
  key_id = '2470aaaf443454022aef85eb7a6297bbb82094a623f85e587129c3bd0926ec06' 
  AND (
    token = 'eGIlx6xcCSHCkH96hxu7q+ffAI6/a0eZhyrMX9I3ihw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042