UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6TsRZwCcIN5FVM1keox9H6fBei4wuAUPBP27D2sUtdA='
WHERE
key_id = '069dfd78b20ff2b3a659f6e71bef7e801ddc944ad59fe7eb1710b09a4ab32689'
AND (
token = '6TsRZwCcIN5FVM1keox9H6fBei4wuAUPBP27D2sUtdA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)