UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XJo32MZz+X3ZceKKKKxwkuKHhQkf3RVY/hszVdHVrXM='
WHERE
key_id = '9ea71545b768ac5451256f0177b0933e3c27c0a441f1d52ee8ef456ecd1502aa'
AND (
token = 'XJo32MZz+X3ZceKKKKxwkuKHhQkf3RVY/hszVdHVrXM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)