UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z0pOq2Qn5fL5jyqB8TJbBdP8MXg0HLwF2WSsLgI8Ass='
WHERE
key_id = 'e198dc7355f8fcaf59e533b28b0f2801dc8ab40a470fa7ca4351a95dbc019981'
AND (
token = 'Z0pOq2Qn5fL5jyqB8TJbBdP8MXg0HLwF2WSsLgI8Ass='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)