UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KBeqaSpRZNsFM2BvjB6Gm3VVhRItdRE/ankd5pLxkcg='
WHERE
key_id = '7d697d01d999bf32f4ef6e5e001e4e59f73b7b650de2e189b0b5438e9ad3309e'
AND (
token = 'KBeqaSpRZNsFM2BvjB6Gm3VVhRItdRE/ankd5pLxkcg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)