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