UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dX6F+Dpt+U5UkvVvptjD2f6geimxPxcNG/GegdYstmc=' 
WHERE 
  key_id = '5fea45a5e6b4017513a155f31710051dab718b4a91699ca1ce1042c038d109e5' 
  AND (
    token = 'dX6F+Dpt+U5UkvVvptjD2f6geimxPxcNG/GegdYstmc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015