UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UENwxeGW72Bk4A3uUZH3yg4MUv6RcKu0J94h7FXYk5Y=' 
WHERE 
  key_id = '5f371f9e675889df97153efd10418cced229238005b00e723cbc17e32281e5b9' 
  AND (
    token = 'UENwxeGW72Bk4A3uUZH3yg4MUv6RcKu0J94h7FXYk5Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023