UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4c/OCDD7vrR8laMfwuDq5W0VJXy/4fyerVARjYeF2SU=' 
WHERE 
  key_id = '8cea4dc09f33817563b660a0bc1801badc5d5098a03cba3602808f7e12884f8f' 
  AND (
    token = '4c/OCDD7vrR8laMfwuDq5W0VJXy/4fyerVARjYeF2SU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035