UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pfF2Rt3gkRgnJQBXT6KpLnKsAE7XKXp9dn4/5EQ0H+g=' 
WHERE 
  key_id = 'a48f87dee07c8d36dea111d2de2812219154ba818d0b86f42f599bc9769dfff1' 
  AND (
    token = 'pfF2Rt3gkRgnJQBXT6KpLnKsAE7XKXp9dn4/5EQ0H+g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00098