UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'n5OAyy4qdTcxhssKz0GmUCdd8W/PfSP46fwbXpyGqjo=' 
WHERE 
  key_id = '448f96dd91672cf5a08551be7e120c3a8ed36901241699b05def5014db6d0fa6' 
  AND (
    token = 'n5OAyy4qdTcxhssKz0GmUCdd8W/PfSP46fwbXpyGqjo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036