UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l0ikOwnP+Nm6V31fgBDPKOJb19Vc+/vWBkAi/GwBf0s='
WHERE
key_id = '0febb7facef9856857de2e13fe97e7476e0a2244f1e53042864f5effe1650b6f'
AND (
token = 'l0ikOwnP+Nm6V31fgBDPKOJb19Vc+/vWBkAi/GwBf0s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)