UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tAR/479t7rIR94u8nRFC6YubaZP7lNh7rCsa5Txt4xk='
WHERE
key_id = 'e92764d1d67f1f3af10f2e1ffe171b5209300da5c04cc749d105a87d58e2dfc6'
AND (
token = 'tAR/479t7rIR94u8nRFC6YubaZP7lNh7rCsa5Txt4xk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)