UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jroFv5CqCTvJRZ+qpwc+j+CT/5vyKifRwZCudbkFQBk=' 
WHERE 
  key_id = 'c129f8955e5a2955dbfffca1a8743055eeeef2b57ec979e851c89905e4036542' 
  AND (
    token = 'jroFv5CqCTvJRZ+qpwc+j+CT/5vyKifRwZCudbkFQBk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026