UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1OeL//ZbPi8UkU2FdtZmvY3XRwIElbDreXq9+XiAU3c='
WHERE
key_id = '0723aef9291760b1fdbb9648e4de5fb9c6a0a5ad403c4ae10582b270e72015b4'
AND (
token = '1OeL//ZbPi8UkU2FdtZmvY3XRwIElbDreXq9+XiAU3c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)