UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'krIrROZh3ZUSCQT4EybY2C/TbZapf5iy9yyG+zSWd9I=' 
WHERE 
  key_id = '5ebbbd6420e33169b00975ced52a044398f21e6c89e4235c59e2dd58d94fa22d' 
  AND (
    token = 'krIrROZh3ZUSCQT4EybY2C/TbZapf5iy9yyG+zSWd9I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016