UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q/6EkFDWmiCHPto29WFmGn6uKt+CjXaohWmlUN3Z2Iw='
WHERE
key_id = 'b82419f01a14c3e0aaa06dc47f65b7dce7938008fd9c209d3bad9138045a71d8'
AND (
token = 'q/6EkFDWmiCHPto29WFmGn6uKt+CjXaohWmlUN3Z2Iw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)