UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uf5CbeIQ3vzXRDjdzhXFcknG/xfaaPXolbMSTuHyNpM=' 
WHERE 
  key_id = '4c7924e6c8d6bfc524338d481fcd9a3b1dea0a17991d33f5123df74b3ec3b75e' 
  AND (
    token = 'uf5CbeIQ3vzXRDjdzhXFcknG/xfaaPXolbMSTuHyNpM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033