UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zAPrhqK0HjeOfDV4muJLij1HyJJxNSJld86EZbrnwZQ='
WHERE
key_id = '450f810d6d97b8901bf5567059dc9beb28b19d6e0eabbe68a9f50165675a91f7'
AND (
token = 'zAPrhqK0HjeOfDV4muJLij1HyJJxNSJld86EZbrnwZQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)