UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mR7hVUuz1Kl8KJGgi1+pqUDdPNhOM7Plpho3jaxQGAU='
WHERE
key_id = 'addafb8516bd203b57f3506f54edf2cf13dfe0cd24091e23685fa7063a49f220'
AND (
token = 'mR7hVUuz1Kl8KJGgi1+pqUDdPNhOM7Plpho3jaxQGAU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)