UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gkUF2UuzsCbzenLNt/IrKwvRb3RF2wVAgiamPd24kLk='
WHERE
key_id = '7b965cf913f07d2135161659cef7d01f53035d6d15ebfa432751ede78eaeaa71'
AND (
token = 'gkUF2UuzsCbzenLNt/IrKwvRb3RF2wVAgiamPd24kLk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)