UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2YGOZybr1byH1X+P7RddTEJRBaF7TwtqeCjSCukIRdM='
WHERE
key_id = '2e8fdbca4d11a84b6b069ec454334f7ccf34b2d2649a4a677318f07f40d07a6f'
AND (
token = '2YGOZybr1byH1X+P7RddTEJRBaF7TwtqeCjSCukIRdM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)