UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1wsJephA6DtbclHlGgvxUtAlxJQLgnHbqFbmi/5QYOc=' 
WHERE 
  key_id = 'e500a0f42d2fcfcdc24850f3cffb61201a1586d59bdb84ea2c1434e00c82bc4d' 
  AND (
    token = '1wsJephA6DtbclHlGgvxUtAlxJQLgnHbqFbmi/5QYOc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031