UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GNMgeLCRcj0DTTAytkQcSscMvmD+/vB2kJQrCwn6cNo=' 
WHERE 
  key_id = 'a6885b95cbb4f07f4f66da3cfbfbe990fde689a8b006c025367f12ea9da7872a' 
  AND (
    token = 'GNMgeLCRcj0DTTAytkQcSscMvmD+/vB2kJQrCwn6cNo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027