UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c3sC+MelH3JuO/jOtuvvK/4MZ1gDV8w96An6ekGZGzU=' 
WHERE 
  key_id = 'd13e4008d22939712b5f9b401d3090b6c4bd251fa947764dbba906c0cb1f01af' 
  AND (
    token = 'c3sC+MelH3JuO/jOtuvvK/4MZ1gDV8w96An6ekGZGzU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025