UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OifU5qQ434PKaB/HslAbJECdW4Jie8AYu1ZFf2aT85I='
WHERE
key_id = 'e2ef26b18e043aefdc8af9214a8f7061555e05f64cda2300b6cd3964e4c56812'
AND (
token = 'OifU5qQ434PKaB/HslAbJECdW4Jie8AYu1ZFf2aT85I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)