UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'voYG7VVw/lj5lSQ3zMnXYsitrkcZ/0tr3tqonQV3dl4=' 
WHERE 
  key_id = 'b0984ffc97881bd5e7bf74e8a4a79f5809c023b04c5afbca611ef8714508e510' 
  AND (
    token = 'voYG7VVw/lj5lSQ3zMnXYsitrkcZ/0tr3tqonQV3dl4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039