UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6ec5DJI4nj++676SoDf6n0IsYGsbnZQv5HYgODN/DVk='
WHERE
key_id = '4bfc9edbdfb49b14173c9865a7552229e0dd31af3ea3dbe54f5cb2a226a87b6f'
AND (
token = '6ec5DJI4nj++676SoDf6n0IsYGsbnZQv5HYgODN/DVk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)