UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0SK+56TpI+KQn7PUfn+mKfU/g0CrVAgyR7zAbUKYY8I=' 
WHERE 
  key_id = '8b63c0ecc441daa283250ac669ada5016f44bafffd83a5b679b5840c96979634' 
  AND (
    token = '0SK+56TpI+KQn7PUfn+mKfU/g0CrVAgyR7zAbUKYY8I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030