UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DtHlRjipPpv1Oo9YJ150WPaiWrHcy1tdMllczYfBVzs='
WHERE
key_id = 'f7bc50d798977e1c3010c8b668bcc3427f40bc63c14b2cffa2c9a9ac29344fa3'
AND (
token = 'DtHlRjipPpv1Oo9YJ150WPaiWrHcy1tdMllczYfBVzs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)