UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AP5sTbweH6x6ZbRtiNEL/5F6h+9b5kS5YyS6D25WkeQ='
WHERE
key_id = '3625e6881be42e6f9f874e84bf3bfd2b74686ef77d43b00f40d76b15debd0019'
AND (
token = 'AP5sTbweH6x6ZbRtiNEL/5F6h+9b5kS5YyS6D25WkeQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)