UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '25VnrZVG9qEovUTBuiEZdXWLBgZfbCMVNkAI8vkLfVs='
WHERE
key_id = 'a103ebc0a72f7a47dd18c46aecd8bd118ffcb96e2d7a1df3dcb5ad4f5af97fb3'
AND (
token = '25VnrZVG9qEovUTBuiEZdXWLBgZfbCMVNkAI8vkLfVs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)