UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zfsDxJk/4HY+JZZvzhbIdzugbDQDJhhuDiNsNEbkBJU='
WHERE
key_id = '82a67c7a2100dc4223e3d2b5fa2bab64ee989e7f943c48f98aee1c09497f1c33'
AND (
token = 'zfsDxJk/4HY+JZZvzhbIdzugbDQDJhhuDiNsNEbkBJU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)