UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zz6Ej58Gx2fT95Q7xzan0OtxpZV3PZBxDcyhMRUd+Hk=' 
WHERE 
  key_id = '9e191e608ad2fd596e3d6875919929c9a3e259526951c94a2cdb085b8d326b34' 
  AND (
    token = 'zz6Ej58Gx2fT95Q7xzan0OtxpZV3PZBxDcyhMRUd+Hk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039