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