UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9G9Zx2L/hznv1FigU+jaaB/K5AGb683UjnLdgQt+g/I='
WHERE
key_id = '0a1b28cce0b1d2af81d09c8cd1ab1f1aa222ef453eeb478b32d04f760275685b'
AND (
token = '9G9Zx2L/hznv1FigU+jaaB/K5AGb683UjnLdgQt+g/I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)