UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kYmO06rBEcNrzCgYM9fhqSahT6aNMCVpRdzKBt1+Mn0=' 
WHERE 
  key_id = '55bea13a3edeb76c7f2334b71a761befe9703d2064d5a442f9fe7f81ab053fe1' 
  AND (
    token = 'kYmO06rBEcNrzCgYM9fhqSahT6aNMCVpRdzKBt1+Mn0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029