UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HEbqL9LOI9oRTPeX3mVnFH055do0stgwqXt4N2Z0hCI='
WHERE
key_id = '7c67a2db926e4b274dfd9dc5036bd8fd6523a56b818f6887095ae97896548dd2'
AND (
token = 'HEbqL9LOI9oRTPeX3mVnFH055do0stgwqXt4N2Z0hCI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)