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