UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '12pOH52VjfRe9iaQQWTe35LCKn0aH9SqhC/UaORM5ZA='
WHERE
key_id = '349a44aac80756422ac7375b9de91150cce72aa1c43f5fa5e2356b15b2993cac'
AND (
token = '12pOH52VjfRe9iaQQWTe35LCKn0aH9SqhC/UaORM5ZA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)