UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DR74lY4L0eqXSn/XDcqNlDExRq4zkIOHPo7X8CNauOI='
WHERE
key_id = '5d657e92faf373e6ab2610b69a4d3e5df189e7dc9ff74ef9ed23de15023739aa'
AND (
token = 'DR74lY4L0eqXSn/XDcqNlDExRq4zkIOHPo7X8CNauOI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)